<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="dictGroupList" checkbox="false" fitColumns="true" title="实验室开放资格管理" actionUrl="labOpenQualifyController.do?auditDatagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="状态"  field="state.value"    queryMode="single" hidden="true"  width="60" align="center"></t:dgCol>
   <t:dgCol title="申请实验室名称"  field="lab.name"   query="true" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="申请人"  field="applyUser.realName"   query="true" queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="申请原因"  field="remark"   query="false" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="状态"  field="state.name"    queryMode="single"  width="60" align="center"></t:dgCol>
   <t:dgCol title="提交日期"  field="submitDate" formatter="yyyy-MM-dd"   queryMode="single"  width="120"></t:dgCol>   
   <t:dgCol title="审核意见"  field="auditContent" queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="考试结果"  field="examContent" queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="操作" field="opt" width="160"></t:dgCol>
   <t:dgDelOpt title="删除" url="changeApplyController.do?doDel&id={id}" exp="state.value#eq#0,3"/>
   <t:dgFunOpt title="审核" funname="audit(id)" exp="state.value#eq#1"></t:dgFunOpt>
   <t:dgFunOpt title="考试结果" funname="auditExam(id)" exp="state.value#eq#2"></t:dgFunOpt>
<%--    <t:dgToolBar title="添加申请" icon="icon-edit" url="labOpenQualifyController.do?goAdd" funname="add" width="500" height="200"></t:dgToolBar> --%>
<%--    <t:dgToolBar title="编辑申请" icon="icon-edit" url="labOpenQualifyController.do?goUpdate" funname="update" width="500" height="200"></t:dgToolBar> --%>
<%--    <t:dgToolBar title="查看" icon="icon-search" url="labOpenQualifyController.do?goUpdate" funname="detail" width="500" height="200"></t:dgToolBar> --%>
 
   </t:datagrid>
  </div>
 </div>
 <script type="text/javascript">
 $(document).ready(function(){
 		//给时间控件加上样式
 		//$("#dictGroupListtb").find("input[name='createDate']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 });
 
 

	function auditExam(id){
		var addurl = 'labOpenQualifyController.do?goExamAudit&id='+id;
		  $.dialog({
			  	id:'deviceReturn',
				content: 'url:'+addurl,
				lock : true,
				zIndex: 50, 
				width:400,
				height:200,
				title:'录入考试结果', 
				opacity : 0.3,
				ok: function(){
					iframe = this.iframe.contentWindow;
					$('#btn_sub', iframe.document).click(); 
	 				return false;
				},
				cache:false,
				close:reloadTable
		});
	}

	function audit(id){
		var addurl = 'labOpenQualifyController.do?goAudit&id='+id;
		  $.dialog({
			  	id:'deviceReturn',
				content: 'url:'+addurl,
				lock : true,
				zIndex: 50, 
				width:400,
				height:200,
				title:'审批', 
				opacity : 0.3,
				ok: function(){
					iframe = this.iframe.contentWindow;
					$('#btn_sub', iframe.document).click(); 
	 				return false;
				},
				cache:false,
				close:reloadTable
		});
	}
 
function submitApply(id){
	var addurl = 'labOpenQualifyController.do?submit&id='+id;
	$.ajax({
		url:addurl,
		success:function(data){
			data = $.parseJSON(data);
			tip(data.msg);
			if(data.success){
				reloadTable();
			}
		}
	});
		  
}
 
 </script>